package com.xmkj.winmoney.jifen;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.SparseArray;

import com.xmkj.winmoney.home.HomeSonFragment;


/**
 * Created by Administrator on 2017/10/26.
 */

public class JiFenPagerAdapter extends FragmentPagerAdapter {
    SparseArray<String> titles;
    Context context;
    public JiFenPagerAdapter(FragmentManager fm) {
        super(fm);
    }
    public JiFenPagerAdapter(FragmentManager supportFragmentManager, SparseArray<String> titles , Context context) {
        super(supportFragmentManager);
        this.titles =titles;
        this.context = context;
    }

    @Override
    public Fragment getItem(int position) {
        return new JiFenSonFragment(position+1);
    }
    @Override
    public int getCount() {
        return titles==null?0:titles.size();
    }
    @Override
    public CharSequence getPageTitle(int position) {
        return titles.get(position);
    }
  
}
